// Vue.use = function (plugin, options) {
//   plugin.install(this, options);
// }
import install from './install.js';
import createMatcher from './create-matcher.js';

class VueRouter {
  constructor(options) {
    this.mode = options.mode;
    this.base = options.base;
    this.routes = options.routes || [];
    this.matcher = createMatcher(this.routes);

    // TODO:
    if (this.mode === 'history') {

    } else {// hash

    }
  }
  init(app) {
    console.log('router init~~~~~~~~~~~~')
    console.log(app._routerRoot);// Vue {}
    console.log(app._routerRoot._router);// VueRouter {}
  }
  createMatcher() {

  }
}

/**
 * @dependencies {static} 为了保证router库不需依赖Vue，而是与项目的Vue保持一致(当用户使用此插件时)
 * @param {*} plugin 
 * @param {*} options 
 */
VueRouter.install = install;
export default VueRouter;